#ifndef VECT3D_H
#define VECT3D_H

#include <math.h>

namespace collisions
{
	// Basic 3 dimensionnal vector with 
	// a few operators overloaded for ease of use
	class Vector3D
	{
	private:
		const friend Vector3D& operator*(const float& a, Vector3D& v)
		{
			return v * a;
		}
		const friend Vector3D& operator/(const float& a, Vector3D& v)
		{
			return v / a;
		}
	public :
		float X,Y,Z;

		//basic constructors
		Vector3D(const float X, const float Y, const float Z);
		Vector3D();

		//operator overloading
		const Vector3D& operator+( const Vector3D& oV );
		const Vector3D& operator-( const Vector3D& oV );
		Vector3D operator-() const; 
		const Vector3D& operator*( const float& a );
		const Vector3D& operator/( const float& a );
		
		void operator*=(const float& a);
		void operator/=(const float& a);
		
		void operator+=(const Vector3D& oV);
		
		//some basic functions:

		//used instead of length when we can omit doing a square root.
		//This is for efficientcy
		float lengthSquared();

		//When we need the exact length of the vector3D
		float length();
	};
}

#endif